package com.kucan.recyclecard.view;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;

import com.kucan.recyclecard.R;
import com.kucan.recyclecard.base.BaseActivity;
import com.kucan.recyclecard.utils.RouteUtil;
import com.kucan.recyclecard.utils.Utils;

public class CustomerDialog extends MyDialog{
    public CustomerDialog(Context context) {
        super(context, true, Gravity.BOTTOM);

        Window w = this.getWindow();
        if (w != null) {
            w.setWindowAnimations(R.style.dialogTranslateAnim);
        }
        View rootView = LayoutInflater.from(context).inflate(R.layout.dialog_customer, null);
        setContentView(rootView);

        rootView.findViewById(R.id.ll_qq).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Utils.copyToClipBoard(context, "3926855352");
            }
        });

        rootView.findViewById(R.id.ll_wx).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                RouteUtil.toBrowser((BaseActivity) context, "https://work.weixin.qq.com/kfid/kfc23a563ee7443bea4");
            }
        });

        rootView.findViewById(R.id.ll_phone).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                RouteUtil.toCallPhone((BaseActivity) context, "400-189-3918");
            }
        });

        rootView.findViewById(R.id.tv_cancel).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();
            }
        });
    }


}
